package com.ie.api.center.data.fegin;

import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ie.api.center.data.hystrix.ControlInfoClientHystrix;
import com.ie.api.center.data.hystrix.RealDataClientHystrix;
import com.xj.common.bean.R;
import com.xj.common.bean.constant.Common;
import com.xj.common.bean.point.PointValue;
import com.xj.common.model.Point;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import java.util.List;
import java.util.Map;


//定义一个feign接口，通过@FeignClient("服务名")，来指定调用哪个服务
@FeignClient(value = Common.Service.IE_DATA_SERVICE_NAME,fallback= RealDataClientHystrix.class)
public interface RealDataClient {
	


	@RequestMapping(value = Common.Service.IE_DATA_REAL+Common.Service.IE_DATA_REAL_BY_DEVICEID, method = RequestMethod.POST)
	R<List<PointValue>> handleGetRealDataByDeviceid(@RequestBody JSONObject jsonParam);

	/**
	 * 根据 ID 删除 Point
	 *
	 * @return Boolean
	 */
	@RequestMapping(value = Common.Service.IE_DATA_REAL+Common.Service.IE_DATA_REAL_BY_DEVICEID_POINTID, method = RequestMethod.POST)
	R<PointValue> handleGetRealDataByDeviceIdAndPointID(@RequestBody JSONObject jsonParam);

	/**
	 * 修改 Point
	 *
	 * @return Point
	 */
	@RequestMapping(value = Common.Service.IE_DATA_REAL+Common.Service.IE_DATA_LIST, method = RequestMethod.POST)
	R<Page<PointValue>> handleGetPointValueList(@RequestBody JSONObject jsonParam);

}






